package com.kefu.chat.controller;

import com.kefu.chat.model.ChatSession;
import com.kefu.chat.service.ChatSessionTagRelService;
import com.kefu.chat.vo.ChatSessionTagRelInsertVo;
import com.kefu.common.controller.AbstractBaseController;
import com.kefu.common.result.Result;
import com.kefu.common.result.ResultGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="会话标签")
@RestController
@RequestMapping("/chat/session/tag/")
public class ChatSessionTagController extends AbstractBaseController{
    @Resource
    private ChatSessionTagRelService chatSessionTagRelService;

    /**
     * 添加会话标签
     * @param chatSessionTagRelVo
     * @return
     */
    @PostMapping("/add")
    @ApiOperation(value="添加会话标签", notes="添加会话标签")
    public Result<ChatSession> detail(@Validated @RequestBody ChatSessionTagRelInsertVo chatSessionTagRelVo) {
        ChatSession session = chatSessionTagRelService.addTag(chatSessionTagRelVo);
        return ResultGenerator.genSuccessResult(session);
    }
}


